﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Web.Helpers
{
    public class FrontHelper
    {
        /// <summary>
        /// 获取作品所属设计师
        /// </summary>
        /// <param name="id">设计师ID</param>
        /// <returns>设计师</returns>
        public static Manager.Model.Admin.M_Stylist GetStylistByOpus(int id)
        {
            Manager.BLL.Admin.M_StylistBll bllStylist=new Manager.BLL.Admin.M_StylistBll();
            return bllStylist.GetModel(id);
        }
        /// <summary>
        /// 获取设计师所属店面
        /// </summary>
        /// <param name="id">设计师ID</param>
        /// <returns>店面</returns>
        public static Manager.Model.Admin.M_Shop GetShopByStylist(int id)
        {
            Manager.BLL.Admin.M_ShopBll bllShop = new Manager.BLL.Admin.M_ShopBll();
            return bllShop.GetModel(id);
        }

        /// <summary>
        /// 获取店面下所有设计师
        /// </summary>
        /// <param name="shopid"></param>
        /// <returns></returns>
        public static IEnumerable<Manager.Model.Admin.M_Stylist> GetStylistList(int shopid)
        {
            Manager.BLL.Admin.M_StylistBll bllStylist = new Manager.BLL.Admin.M_StylistBll();
            return bllStylist.GetModelList("IsValid=1 And IsTop=1 And StylistShopID="+shopid).Take(4);
        }
    }
}